import request from "@/utils/request";

// 查询考勤规则列表
export function listUser_role(query) {
  return request({
    url: "/system/user_role/list",
    method: "get",
    params: query,
  });
}

// 查询考勤规则详细
export function getUser_role(id) {
  return request({
    url: "/system/user_role/" + id,
    method: "get",
  });
}

// 新增考勤规则
export function addUser_role(data) {
  return request({
    url: "/system/user_role",
    method: "post",
    data: data,
  });
}

// 修改考勤规则
export function updateUser_role(data) {
  return request({
    url: "/system/user_role",
    method: "put",
    data: data,
  });
}

// 删除考勤规则
export function delUser_role(id) {
  return request({
    url: "/system/user_role/" + id,
    method: "delete",
  });
}
export function getUserRuleByUserId(userId) {
  return request({
    url: "/system/user_role/selectUserRuleByUserId",
    method: "get",
    params: { userId, status: 1 }, // status: 1 表示启用状态
  });
}
